home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-05 / wait4f.zip / W4F-SAMP.BAT < prev    next >
DOS Batch File  |  1991-12-05  |  1KB  |  37 lines

  1. @ECHO OFF
  2. WAIT4FIL %1 %2 %3
  3. IF ERRORLEVEL 2 GOTO EscPressed
  4. IF ERRORLEVEL 1 GOTO LimitReached
  5. IF ERRORLEVEL 0 GOTO SyntaxError
  6. GOTO Okay2Process
  7. REM  -----------------------------------------------------------------------
  8. :Okay2Process
  9. ECHO  File's Here! Processing It!
  10. ECHO  This is where you would place commands to be executed when (and IF)
  11. ECHO  the file ever appears
  12. GOTO ExitBat
  13. REM  -----------------------------------------------------------------------
  14. :EscPressed
  15. ECHO  You've pressed ESC to stop waiting before the file actually appeared
  16. GOTO ExitBat
  17. REM  -----------------------------------------------------------------------
  18. :LimitReached
  19. ECHO  Waited Too Long. File Never Appeared!
  20. ECHO  You've waited long enough and the file hasn't appeared yet. This is
  21. ECHO  where you would place whatever commands should be executed if the
  22. ECHO  expected file NEVER appears.
  23. GOTO ExitBat
  24. REM  -----------------------------------------------------------------------
  25. :SyntaxError
  26. PAUSE
  27. CLS
  28. ECHO  You must include at LEAST a file name on the command line when running
  29. ECHO  this Batch Program
  30. GOTO ExitBat
  31. REM  -----------------------------------------------------------------------
  32. :ExitBat
  33. ECHO -----------------------------------------------------------------------
  34. ECHO  Batch Program Terminated
  35. ECHO -----------------------------------------------------------------------
  36.  
  37.